Fix hyperactive warnings in new clang/gcc versions.
authorRobert Lipe <robertlipe@gpsbabel.org>
Thu, 2 Nov 2017 21:55:10 +0000 (16:55 -0500)
committerRobert Lipe <robertlipe@gpsbabel.org>
Thu, 2 Nov 2017 21:55:10 +0000 (16:55 -0500)
garmin_txt.cc
zlib/README.gpsbabel
zlib/inflate.c

index 5a6f0128b477f89f15e12cc0a38e579e824afa78..93e3f2b1745183fa47d2a426cd06fa1159600b17 100644 (file)
@@ -62,7 +62,7 @@ static time_t utc_offs = 0;
 // Having a Windows background, this software encodes degree marks in
 // Windows CP-1252.  We don't attempt to handle all the subtleties of that,
 // but since we write degree marks and we know how they're encoded, use this.
-static const int kDegreeSymbol = 0xB0;
+static const char kDegreeSymbol = 0xB0;
 
 static gtxt_flags_t gtxt_flags;
 
index 350f999a6d8607fe1cddc0c284f96b404cb4daa3..a9e511930f8bf1fdb4c913acf4d985520263c2fb 100644 (file)
@@ -2,4 +2,5 @@ modified subset of zlib-1.2.8 from zlib.net.
 1.  zconf.h is modified to include our config.h
 2.  gzlib.c is modified to resolve a seek problem with uncompressed files on windows platforms build with mingw32 gcc.
 see gzlib.patch
+3.  inflatte.c: fix hyper Warning inflateMark() about shifting a negative number - shift, then negate instead.
 
index 870f89bb4d3646684bf37e2144c4b83c808ab84d..777db29f2fe347a9299076feb2237605cbf61696 100644 (file)
@@ -1503,8 +1503,12 @@ long ZEXPORT inflateMark(strm)
 z_streamp strm;
 {
     struct inflate_state FAR *state;
-
-    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
+// Begin GPSBabel
+//Orig
+//  if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
+// Fix
+    if (strm == Z_NULL || strm->state == Z_NULL) return -(1L << 16);
+// End GPSBabel
     state = (struct inflate_state FAR *)strm->state;
     return ((long)(state->back) << 16) +
         (state->mode == COPY ? state->length :